home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / var / lib / dpkg / info / python2.5-minimal.postinst < prev    next >
Encoding:
Text File  |  2007-05-02  |  1.9 KB  |  60 lines

  1. #! /bin/sh
  2.  
  3. set -e
  4.  
  5. if [ "$1" = configure ]; then
  6.     (
  7.     cd /usr/lib/python2.5
  8.     files=$(dpkg -L python2.5-minimal | sed -n '/\.py$/s,^/usr/lib/python2.5/,,p')
  9.     /usr/bin/python2.5 /usr/lib/python2.5/py_compile.py $files
  10.     if grep -sq '^byte-compile[^#]*optimize' /etc/python/debian_config; then
  11.         /usr/bin/python2.5 -O /usr/lib/python2.5/py_compile.py $files
  12.     fi
  13.     )
  14.     bc=no
  15.     if [ -z "$2" ] || dpkg --compare-versions "$2" lt 2.5-3 \
  16.         || [ -f /var/lib/python/python2.5_installed ]; then
  17.     bc=yes
  18.     fi
  19.     if ! grep -sq '^supported-versions[^#]*python2.5' /usr/share/python/debian_defaults
  20.     then
  21.     # FIXME: byte compile anyway?
  22.     bc=no
  23.     fi
  24.     if [ "$bc" = yes ]; then
  25.     # new installation or installation of first version with hook support
  26.     if [ "$DEBIAN_FRONTEND" != noninteractive ]; then
  27.         echo "Linking and byte-compiling packages for runtime python2.5..."
  28.     fi
  29.     version=$(dpkg -s python2.5-minimal | awk '/^Version:/ {print $2}')
  30.     for hook in /usr/share/python/runtime.d/*.rtinstall; do
  31.         [ -x $hook ] || continue
  32.         $hook rtinstall python2.5 "$2" "$version"
  33.     done
  34.     if [ -f /var/lib/python/python2.5_installed ]; then
  35.         rm -f /var/lib/python/python2.5_installed
  36.         rmdir --ignore-fail-on-non-empty /var/lib/python 2>/dev/null
  37.     fi
  38.     fi
  39. fi
  40.  
  41. case "$1" in
  42.     configure)
  43.         # Create empty directories in /usr/local
  44.         if [ ! -e /usr/local/lib/python2.5 ]; then
  45.             mkdir -p /usr/local/lib/python2.5 2> /dev/null || true
  46.             chmod 2775 /usr/local/lib/python2.5 2> /dev/null || true
  47.             chown root:staff /usr/local/lib/python2.5 2> /dev/null || true
  48.         fi
  49.         if [ ! -e /usr/local/lib/python2.5/site-packages ]; then
  50.             mkdir -p /usr/local/lib/python2.5/site-packages 2> /dev/null || true
  51.             chmod 2775 /usr/local/lib/python2.5/site-packages 2> /dev/null || true
  52.             chown root:staff /usr/local/lib/python2.5/site-packages 2> /dev/null || true
  53.         fi
  54.     ;;
  55. esac
  56.  
  57.  
  58.  
  59. exit 0
  60.